// Author: combacsa@kaist.ac.kr
// http://www.jungol.co.kr/prog/Hanal/hanalView.php?qs_code=1009

//#define COMPILE
#ifdef COMPILE

#include <fstream>

using namespace std;

ifstream in("input.txt");
ofstream out("output.txt");

int n;

bool input() {
    in >> n;
    if (n == 0)
        return false;
    else
        return true;
    
}

void output() {
    int m = n;
    int sum = 0;
    bool begin_zero = true;
    while (m > 0) {
        int now = m % 10;
        if (now == 0 && begin_zero) {
        } else {
            begin_zero = false;
            out << now;
            sum += now;
        }
        m /= 10;
    }
    out << " " << sum << endl;
}

int main() {
    while (input()) {
        output();
    }
    in.close();
    out.close();
    return 0;
}


#endif
